#include <iostream>

using namespace std;
class A
{
public:
    bool isUnique(string astr)
    {
        if (astr.size() > 26)
            return false;
        int r = 0;
        for (auto i : astr)
        {
            int x = i - 'a';
            if ((r >> x) & 1 == 1)
                return false;
            r |= (1 << x);
        }
        return true;
    }
};

int main()
{
    A q;
    string a = "abcdefs";
    string b = "abdgaowler";
    cout << q.isUnique(a)<<endl;
    cout << q.isUnique(b) << endl;

    return 0;
}